package com.example.core.utils;

import org.springframework.aop.framework.Advised;
import org.springframework.aop.framework.AopProxyUtils;

public class ProxyClassUtil {

    /***
     * 获取实际的类型
     * @param object
     * @return
     */
    public static Class<?> getRealClass(Object object) {
        if (object instanceof Advised) {
            Advised advised = (Advised) object;
            return AopProxyUtils.ultimateTargetClass(advised);
        }
        return object.getClass();
    }
}
